---
title: "Update"
"og:title": "dub.links.update - Edit a link - TypeScript SDK"
description: "Edit a link for the authenticated workspace. Support partial updates."
---

import LinkArguments from "/snippets/link-arguments.mdx";
import LinkResponse from "/snippets/link-response.mdx";

## Arguments

<ParamField body="url" type="string">
  The destination URL of the short link.
</ParamField>

<LinkArguments />

## Response

<LinkResponse />

<RequestExample>

```ts
// Update a link by its linkId
await dub.links.update("clv3o9p9q000au1h0mc7r6l63", {
  url: "https://www.google.com",
});

// Update a link by its externalId
await dub.links.update("ext_123", {
  url: "https://www.google.com",
});
```

</RequestExample>

<ResponseExample>

```ts
{
  id: 'clv3o9p9q000au1h0mc7r6l63',
  domain: 'dub.sh',
  key: 'e7qzMuI',
  externalId: "123",
  url: 'https://www.google.com',
  archived: false,
  expiresAt: null,
  expiredUrl: null,
  password: null,
  proxy: false,
  title: null,
  description: null,
  image: null,
  rewrite: false,
  ios: null,
  android: null,
  geo: null,
  publicStats: false,
  tagId: 'clv3j1h7o00032u1ngo8luv84',
  tags: [
    {
      id: 'clv3j1h7o00032u1ngo8luv84',
      name: 'news',
      color: 'blue'
    }
  ],
  comments: null,
  shortLink: 'https://dub.sh/e7qzMuI',
  qrCode: 'https://api.dub.co/qr?url=https://dub.sh/e7qzMuI?qr=1',
  utmSource: null,
  utmMedium: null,
  utmCampaign: null,
  utmTerm: null,
  utmContent: null,
  userId: 'cludszk1h0000wmd2e0ea2b0p',
  workspaceId: 'ws_clugls3tn000lwfotbpy30304',
  clicks: 0,
  lastClicked: null,
  createdAt: '2024-04-17T10:31:00.398Z',
  updatedAt: '2024-04-17T10:31:00.398Z',
  projectId: 'clugls3tn000lwfotbpy30304'
}
```

</ResponseExample>
